/*
 * Main_View.java
 *
 * Created on 2009年3月18日, 下午10:42
 */
package view;

import model.GetID_Model;
import ucm.Card_UC;

/**
 *
 * @author  马凯
 */
public class Main_View extends javax.swing.JFrame {

    /** Creates new form Main_View */
    public Main_View() {
        initComponents();
        this.setLocationRelativeTo(null);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLayeredPane1 = new javax.swing.JLayeredPane();
        jLabel1 = new javax.swing.JLabel();
        cid_TF = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("EOSPAN");

        jLabel1.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\马凯\\My Documents\\水纹.jpg")); // NOI18N
        jLabel1.setBounds(0, 0, 620, 600);
        jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.PALETTE_LAYER);

        cid_TF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cid_TFActionPerformed(evt);
            }
        });
        cid_TF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                cid_TFKeyPressed(evt);
            }
        });
        cid_TF.setBounds(20, 20, 260, 21);
        jLayeredPane1.add(cid_TF, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 620, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 600, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    private void cid_TFKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_cid_TFKeyPressed
        if ((evt.getKeyCode() == 13 || evt.getKeyCode() == 10)) {
            
            Card_UC.getInstance(this).run();
        } else {
            //this.cid_TF.setText("");
        }
    }//GEN-LAST:event_cid_TFKeyPressed

    private void cid_TFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cid_TFActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cid_TFActionPerformed

    public GetID_Model getIDModel() {
        GetID_Model gm = new GetID_Model();
        gm.setCid(cid_TF.getText());
        return gm;
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Main_View().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField cid_TF;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLayeredPane jLayeredPane1;
    // End of variables declaration//GEN-END:variables
}
